"""
When creating the TCP connection, we associate with it the client socket address (IP address and port number) and
the server socket address (IP address and port number).
With the TCP connection established, when one side wants to send data to the other side, it just drops the data into
the TCP connection via its socket. This is different from UDP, for which the server must attach a destination
address to the packet before dropping it into the socket.
"""

from socket import *
serverName = '192.168.124.17'
serverPort = 13000

clientSocket = socket(AF_INET, SOCK_STREAM)
clientSocket.connect((serverName, serverPort))

sentence = input('Input lowercase sentence:')
clientSocket.send(sentence.encode())

modifiedSentence = clientSocket.recv(1024)
print('From Server: ', modifiedSentence.decode())

clientSocket.close()
